using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Faust.Andrew.MTG
{
    public class CardMatch
    {
        private string _name;
        public string Name
        {
            get { return _name; }
        }

        private MatchStates _matchState;
        public MatchStates MatchState
        {
            get { return _matchState; }
        }

        private Card _exactMatch;
        public Card ExactMatch
        {
            get { return _exactMatch; }
            set { _exactMatch = value; }
        }

        private List<Card> _possibleMatches;
        public List<Card> PossibleMatches
        {
            get { return _possibleMatches; }
        }

        private int _count;
        public int Count
        {
            get { return _count; }
        }

        private bool _isSideboard;
        public bool IsSideboard
        {
            get { return _isSideboard; }
            set
            {
                _isSideboard = value;
            }
        }
        

        public CardMatch(string name, Card exactMatch, List<Card> possibleMatches, MatchStates matchState, int count, bool isSideboard)
        {
            _name = name;
            _exactMatch = exactMatch;
            _possibleMatches = possibleMatches ?? new List<Card>();
            _matchState = matchState;
            _count = count;
            _isSideboard = isSideboard;
        }

        public void SetMatch(Card card)
        {
            if (card == null)
                throw new ArgumentNullException("card", "card is null.");

            _exactMatch = card;
            _matchState = MatchStates.Match;
        }

        public void RejectMatch(MatchStates state)
        {
            _matchState = state;
            _exactMatch = null;
        }
    }
}
